﻿using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.culture
{
    public class CutlerDeelImagesHander : IRequestHandler<CutlerDeelImagesCommond, Rulst>
    {

        private readonly IbaseRpository<ProductionPutImages> _ProductionPutImages;

        public CutlerDeelImagesHander(IbaseRpository<ProductionPutImages> productionPutImages)
        {
            _ProductionPutImages = productionPutImages;
        }

        public async Task<Rulst> Handle(CutlerDeelImagesCommond request, CancellationToken cancellationToken)
        {
            var query = new Rulst() { Code = (int)Reult.success };


            var list=_ProductionPutImages.Query().Where(x=>x.ProDuctionBasicid==request.ProDtctionid&&x.PutImages==request.images).FirstOrDefault();
            if(list!=null)
            {
                var result = _ProductionPutImages.Deel(list);
                query.MSG = "删除成功";
            }

            



            return query;

        }
    }
}
